using Andromeda.Global.Business.DataObject;
using ForgeIt.Dal.dbo;
using System;

using System.Collections.Generic;
using System.Linq;
using Andromeda.Global.Data;

namespace ForgeIt.Business.Stub
{
	public abstract class ApplicationStub : DataObjectModelBase
	{
		#region private fields


		private DBApplication foDBApplication;


		#endregion private fields
    
		#region public constructors

		protected ApplicationStub()
			: this(new DBApplication())
		{
		}

		#endregion public constructors
    

		#region internal constructors

		internal ApplicationStub(DBApplication foDBApplication)
		{

			this.foDBApplication = foDBApplication;

		}

		#endregion internal constructors
  

		#region protected datasource properties
		

		internal DBApplication DB_DBApplication
		{
			get { return foDBApplication ?? (foDBApplication = new DBApplication()); }
		}

		
		public override DataConnectorCollection DataObjects
		{
			get
			{
				return new DataConnectorCollection { foDBApplication } ;
			}
		}

		

		/// 
		///
		/// 
		public int IdApplication
		{
			get { return DB_DBApplication.IdApplication; }

		}

		/// 
		///
		/// 
		public string AppKey
		{
			get { return DB_DBApplication.AppKey; }

			set { DB_DBApplication.AppKey = value; }

		}

		/// 
		///
		/// 
		public string Name
		{
			get { return DB_DBApplication.Name; }

			set { DB_DBApplication.Name = value; }

		}

		/// 
		///
		/// 
		public string Description
		{
			get { return DB_DBApplication.Description; }

			set { DB_DBApplication.Description = value; }

		}

		#endregion protected datasource properties
    
		#region protected datasource foreign key properties
    

  
		#endregion protected datasource foreign key properties
    
		#region protected datasource external key properties
    

  
		#endregion protected datasource external key properties
    
		#region properties
    

		#endregion properties
    
		#region methods methods

		#endregion methods

        #region Static Factories

        public static Application GetApplication(int foIdApplication)
        {
          return new Application(DBApplication.GetEntity(foIdApplication));
        }
  
        public static IEnumerable<Application> ListApplication()
        {
            return (from DBApplication entity in DBApplication.ListEntity() select new Application(entity));
        }
        
  
        public static IEnumerable<Application> ListApplication(object foIdApplication, object foAppKey, object foName, object foDescription)
        {
            return (from DBApplication entity in DBApplication.ListEntity(foIdApplication, foAppKey, foName, foDescription) select new Application(entity));
        }
        
        #endregion Static List Methods

	
  }
}